package cn.edu.fudan.tools;
//求欧式距离
import java.util.List;

public class SimilarityMeasure {
	public double calEucliDistance(List<Double> A, List<Double> B){
		if(A.size() != B.size() || A.size()*B.size() == 0){
			return -1;
		}
		
		double EucliDistance = 0;
		for(int i = 0; i < A.size(); i ++){
			EucliDistance += (A.get(i) - B.get(i))*(A.get(i) - B.get(i));
		}
		
		return EucliDistance;
	}
}
